﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Paradox.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var story = (Story)ViewData["StoryText"]; 
    %>
    <div id="Story_Placeholder" class="story">
        <h2>
            <%=Html.Encode(story.title) %>
        </h2>
        <div class="subHeading">
            <%= Html.Encode(String.Format("{0:d}", story.posted_on)) %>
            - Author:
            <%= Html.Encode(story.Author) %>
        </div>
        <div id="StoryText">
            <%= story.StoryText %>
        </div>
    </div>
    <fieldset>
        <legend>Comments</legend>
        <ul>
            <% foreach (var item in (List<Comment>)ViewData["StoryComments"])
               { %>
            <li>
                <div class="commentHeading">
                    <strong>
                        <%= Html.Encode(item.comment_posted_by)%>
                    </strong>,
                    <%= Html.Encode( String.Format("{0:g}",item.comment_posted_on)) %>
                </div>
                <div class="commentText">
                    <%= Html.Encode(item.comment_body) %>
                </div>
            </li>
            <%}%>
        </ul>
    </fieldset>
    
    <div id="storyTags" class="tagscontainer" >
    <fieldset>
    <legend>Story Tags</legend>
    <ul id="tags" class="taglist">
    <%foreach (var item in (List<Tag>)ViewData["StoryTags"])
      { %>
    
        <li>
            <%=Html.Encode(item.tagName) %>
        </li>
    
    
    <%} %>
    
    </ul>
    
        
     <% Html.RenderPartial("CreateTag"); %>
    
    
    </fieldset>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderScripts" runat="server">
</asp:Content>
